#pragma once

#include "SkinDef.h"
#include "SkinableGUIImage.h"

// CSkinableGUIButton
namespace SkinableGUI
{
	class CSkinableGUIButton : public CButton
	{
		DECLARE_DYNAMIC(CSkinableGUIButton)

	public:
		CSkinableGUIButton(SkinButton * pSkinButton);
		virtual ~CSkinableGUIButton();

	protected:
		DECLARE_MESSAGE_MAP()

	protected:
		SkinButton * m_pSkinButton;
		HBRUSH m_hBkBrush;
		CSkinableGUIImage m_BackgroundImage;

	public:
		afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
		afx_msg HBRUSH CtlColor(CDC* /*pDC*/, UINT /*nCtlColor*/);
		afx_msg void OnDestroy();
	protected:
		virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	public:
		afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
		virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
		afx_msg void OnTimer(UINT_PTR nIDEvent);

	protected:
		void DrawButtonImage(CDC * pDC,
			CSkinableGUIImage * pImage , const CRect & rcItem, UINT nFrame = 0);
	};

	#define IDT_SKINABLE_BUTTON 100
}

